<?php
class Friend {

    private static $OneWayMessageWeight = 0;
    private static $TwoWayMessageWeight = 5;
    private static $PostWeight = 3;
    private static $CommentWeight = 1;
    private static $LikeWeight = 2;
    
    private $fId;
	private $name;

	private $numberOfOneWayMessages;
	private $numberOfTwoWayMessages;
	private $numberOfPosts;
    private $numberOfComments;
	private $numberOfLikes;
	
	public function __construct($fId, $name){
		$this->fId = $fId;
		$this->name = $name;
		$this->numberOfOneWayMessages = 0;
		$this->numberOfTwoWayMessages = 0;
		$this->numberOfPosts = 0;
		$this->numberOfComments = 0;
		$this->numberOfLikes = 0;
	}
	
	public function getFId(){
		return $this->fId;
	}
	
	public function getName(){
		return $this->name;
	}

	public function getNumberOfOneWayMessages(){
	    return $this->numberOfMessages;
	}
	public function getNumberOfTwoWayMessages(){
	    return $this->numberOfMessages;
	}
	
	public function getNumberOfPosts(){
	    return $this->numberOfPosts;
	}
	
	public function getNumberOfComments(){
	    return $this->numberOfComments;
	}
	
	public function getNumberOfLikes(){
	    return $this->numberOfLikes;
	}
	
	public function increaseOneWayMessages(){
		$this->numberOfOneWayMessages++;
	}
	
	public function increaseTwoWayMessages(){
		$this->numberOfTwoWayMessages++;
	}

	public function increasePosts(){
	    $this->numberOfPosts++;
	}
	
	public function increaseComments(){
	    $this->numberOfComments++;
	}
	
	public function increaseLikes(){
	    $this->numberOfLikes++;
	}
	
	/*
	 * Psychological Distance Function
	 */
	public function getScore(){
		return ($this->numberOfTwoWayMessages * self::$TwoWayMessageWeight) 
		        + ($this->numberOfOneWayMessages * self::$OneWayMessageWeight)
		        + ($this->numberOfPosts * self::$PostWeight)
		        + ($this->numberOfComments * self::$CommentWeight)
		        + ($this->numberOfLikes * self::$LikeWeight);
	}
	
}